<?php
header('content-type:text/html;charset=utf-8;');
$conn=mysqli_connect('localhost','root','root','user');
mysqli_set_charset($conn,'utf8');
$u=$_GET['username'];
$p=$_GET['password'];
$sql="select * from userinfo where username='$u' and password='$p'";
$res = mysqli_query($conn,$sql);
if($row=mysqli_fetch_row($res)){
    echo "1";
}else{
    echo "0";
}

?>